<template>
  <Card :shadow="shadow">
    <div class="card-name"><div class="name width1">订单详情</div></div>
    <div class="content-con">
      <div class="bank-form">
        <div class="form-item">
          <Row :gutter="24">
            <i-col span="12" v-for="(paid, index) in newPaidData" :key="index">
              <Row style="padding-top: 15px;">
                <i-col span="8" class="ban-left">{{ paid.title }}</i-col>
                <i-col span="16"><i-input :value.sync="paid.value" size="large" readonly></i-input></i-col>
              </Row>
            </i-col>
          </Row>
        </div>
      </div>
    </div>
    <div class="card-name"><div class="name width1">代付信息</div></div>
    <div class="content-con">
      <div class="bank-form">
        <div class="form-item">
          <Row :gutter="24">
            <i-col span="12" v-for="(paid, index) in bankData" :key="index">
              <Row style="padding-top: 15px;">
                <i-col span="8" class="ban-left">{{ paid.title }}</i-col>
                <i-col span="16"><i-input :value.sync="paid.value" size="large" readonly></i-input></i-col>
              </Row>
            </i-col>
          </Row>
        </div>
      </div>
      <div class="ban-btn"><i-button class="save" size="large" @click="btnClick1">返回</i-button></div>
    </div>
  </Card>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
  name: 'paid-order-details',
  props: {
    shadow: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      value: '',
      paidData: [
        {
          title: '代付订单号',
          value: this.$route.params.row.order_no
        },
		{
		  title: '商户订单号',
		  value: this.$route.params.row.out_order_no
		},
        {
          title: '商户ID',
          value: this.$route.params.row.uid
        },

        {
          title: '商户名称',
          value: this.$route.params.row.nickname
        },
        {
          title: '通道名称',
          value: this.$route.params.row.channel_name
        },
        {
          title: '受理人',
          value: this.$route.params.row.cuid
        },
        {
          title: '代付金额(元)',
          value: this.$route.params.row.issue_money
        },
        {
          title: '代付手续费(元)',
          value: this.$route.params.row.poundage
        },
        {
          title: '扣减金额(元)',
          value: (parseFloat(this.$route.params.row.issue_money) + parseFloat(this.$route.params.row.poundage)).toFixed(2)
        },

        // {
        //   title: '银行代码',
        //   value: this.$route.params.row.order_no
        // },
        {
          title: '客户端IP',
          value: this.$route.params.row.paid_ip
        },
        // {
        //   title: '设备',
        //   value: this.$route.params.row.order_no
        // },
        {
          title: '通知地址',
          value: this.$route.params.row.notice_url
        },

        {
          title: '创建时间',
          value: this.$route.params.row.add_time
        },
        {
          title: '处理时间',
          value: this.$route.params.row.dispose_time
        },

        {
          title: '状态',
          value: this.$route.params.row.status
        },
        {
          title: '备注',
          value: this.$route.params.row.fail_mark
        }
      ],
      bankData: [
        {
          title: '银行名称',
          value: this.$route.params.row.bank_name
        },

        {
          title: '账户名',
          value: this.$route.params.row.account_name
        },
        {
          title: '账户号(银行卡号)',
          value: this.$route.params.row.account
        },
        {
          title: '下发金额(元)',
          value: this.$route.params.row.issue_money
        },

        {
          title: '转账单号',
          value: this.$route.params.row.transfer_no
        }
      ]
    }
  },
  computed: {
    newPaidData () {
      let data = []
      let name
      switch (this.paidData[13].value.toString()) {
        case '0':
          name = '待处理'
          break
        case '1':
          name = '处理中'
          break
        case '2':
          name = '成功'
          break
        case '3':
          name = '失败'
          break
        case '4':
          name = '回退'
          break
      }
      this.paidData[13].value = name
      data = this.paidData
      return data
    }
  },
  created () {
    
  },
  methods: {
    ...mapMutations(['closeTag']),
    close () {
      this.closeTag({
        name: 'paid-order-details',
        params: {
          row: this.$route.params.row
        }
      })
    },
    // 返回按钮
    btnClick1 () {
      this.close()
    }
    // 返回按钮
    // btnClick1(){
    //   this.$router.push({name:'paid_order'})
    // }
  }
}
</script>
<style lang="less"></style>
